HTTP Protocol
A stateless (no cache, cookies, log, etc) application layer protocol used for the transmission of resources like HTML, running on top of TCP. Specifically designed for communication between web browsers and servers.
Utilises the typical client-server architecture for communication whereby the browser is the client and the web server is the server. Resources are uniquely identified with a URL/URI.
HTTP has 2 versions; 1.0 and 1.1.
HTTP Requests
Clients communicate with servers with requests and servers respond to client requests with responses.
Data transmitted with HTTP can be encrypted with TLS (HTTPS)
HTTP Requests are usually made up of:
- HTTP protocol version
- HTTP method - GET, POST, OPTIONS, HEAD, PUT, DELETE (used to specify what clients want to do)
- Path - Path of file/document
- HTTP headers
HTTP Responses
Typically made up of:
- HTTP protocol version
- Status code - was the request successful? (100, 200, 300, 400, 500)
- HTTP Headers
HTTP Request Headers
Easily identified as they contain colons
Used to specify additional information that needs to be sent in an HTTP request or respnse
Used in requests to specify information pertinent to the requirements of the client for the server to process the request correctly.
HTTP Response Header
Method, path to resource, HTTP version, then all the headers
